1. Field of the Invention
The present invention relates to a technique for encoding image data.
2. Description of the Related Art
The following encoding method is available as a technique for compressing a multi-valued image that is a mixture of characters or line drawings and natural images: Inputting an image in block units from an input multi-valued image; extracting identification information indicating whether a pixel is a character or line-drawing image having a color or density designated in advance; applying entropy encoding to the extracted identification information; and, on the other hand, encoding a multi-valued image that is not a character or line drawing by using an orthogonal transform or the like.
Japanese Patent Application Laid-Open No. 04-326669 can be mentioned as one example of a reference that discloses such a technique. According to this reference, an input image is divided into blocks serving as units of orthogonal transformation at the time of encoding, after which a maximum-frequency value, which is a value having the highest probability of occurrence within a block, is assumed to be indicative of a character or line-drawing image. Color information or density information having the maximum-frequency value is then adopted as an extracted color. For every pixel within the block, binary identification information is generated for identifying whether the pixel is one that belongs to the extracted color or one that is a non-extracted color. Lossless encoding processing such as run-length encoding is then applied to the generated identification information. Further, the value of a pixel having the extracted color is replaced with an average value of pixels of the non-extracted colors. The multi-valued image after replacement is then subjected to lossy encoding such as JPEG encoding. Thus, two items of encoded data and an extracted color are combined to generate one block of encoded data.
In case of an image having an attribute of a character or line drawing, it is desired that the edge of the image be retained. In other words, it is preferred that an image having the attribute of a character or line drawing be so adapted that the resolution thereof is maintained.
On the other hand, in the case of an image having the attribute of a natural image, tonality is more important than resolution. That is, in the case of a natural image, a decline in image quality will not be conspicuous even if resolution is lowered somewhat.
If the patent reference cited earlier is considered in this light, it is possible for the resolution of a character or line-drawing image to be maintained, but there remains room for improvement with regard to a natural image.